########################################################
# CMake file for CPAR Project
########################################################

CMAKE_MINIMUM_REQUIRED( VERSION 2.6 )

# Project setup
PROJECT( CCPAR )
SET( ${PROJECT_NAME}_MAJOR_VERSION 0 )
SET( ${PROJECT_NAME}_MINOR_VERSION 1 )
SET( ${PROJECT_NAME}_PATCH_LEVEL 0 )

ENABLE_TESTING()

MACRO (DECLARE_OS OS_NAME SEARCH_TERM)
	SET( CPAR_OS_${OS_NAME} 0)
	IF(${CMAKE_SYSTEM_NAME} MATCHES ${SEARCH_TERM})
		SET( CPAR_OS_${OS_NAME} 1)
		ADD_DEFINITIONS("-DCPAR_OS_${OS_NAME}")
	ENDIF (${CMAKE_SYSTEM_NAME} MATCHES ${SEARCH_TERM})	
ENDMACRO(DECLARE_OS)

DECLARE_OS(WINDOWS "Windows")
DECLARE_OS(LINUX "Linux")
DECLARE_OS(MACOS "Darwin")
DECLARE_OS(SOLARIS "Solaris")

#options
OPTION( GENERATE_DOC "Set to OFF if you do not want documentation" )

ADD_SUBDIRECTORY( rt )
#ADD_SUBDIRECTORY( compiler )
